package com.xywy.fwc.net;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.xywy.find.bean.FwcQuestionBean;
import com.xywy.fwc.bean.FwcAssea;

public class QuestionParser extends BaseParser<List<FwcQuestionBean>> {

	@Override
	public List<FwcQuestionBean> parseJson(String result) {
		List<FwcQuestionBean> list = null;
		try {
			JSONObject json = new JSONObject(result);
			JSONObject array = json.optJSONObject("data");
			JSONArray data = array.optJSONArray("list");
			System.out.println(data);
			Gson gson = new Gson();
			list = gson.fromJson(data.toString(), new TypeToken<List<FwcQuestionBean>>(){}.getType());
			return list;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

}
